package com.zy.mc_module.ui.micang;

import com.zy.mc_module.mvp.bean.MasterLevelBean;
import com.zy.mc_module.mvp.bean.PageBean;
import com.zy.mc_module.mvp.bean.RiceDetailBean;
import com.zy.mc_module.mvp.bean.RiceStoreHouseBean;
import com.zy.mc_module.mvp.bean.TeamMemberBean;
import com.zy.mc_module.mvp.bean.UserActiveBean;
import com.zy.mc_module.mvp.bean.UserBean;
import com.zy.mc_module.mvp.bean.UserExperienceBean;
import com.zy.mc_module.mvp.bean.UserTaskCount;
import com.zy.mc_module.utils.retrofit.RetrofitManager;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

public class RiceModel implements RiceContract.Model{

    @Override
    public Observable<UserBean.UserMemberInfo> getUserBaseInfo() {
        return RetrofitManager.getInstance().getApi().getUserBaseInfo();
    }

    @Override
    public Observable<PageBean<TeamMemberBean>> getMyTeamMember() {
        return RetrofitManager.getInstance().getApi().getMyTeamMember();
    }

    @Override
    public Observable<UserTaskCount> userTaskCount() {
        return RetrofitManager.getInstance().getApi().userTaskCount();
    }

    @Override
    public Observable<List<RiceStoreHouseBean>> riceStoreHouseFindAll() {
        return RetrofitManager.getInstance().getApi().riceStoreHouseFindAll();
    }

    @Override
    public Observable<PageBean<RiceStoreHouseBean>> getUserRiceStoreList(int state, int page) {
        Map<String,Object> params = new HashMap<>();
        params.put("pageNum",page);
        params.put("pageSize",10);
        params.put("state",state);
        return RetrofitManager.getInstance().getApi().getUserRiceStoreList(params);
    }

    @Override
    public Observable<PageBean<RiceDetailBean>> userAccountRecord(int page) {
        Map<String,Object> params = new HashMap<>();
        params.put("pageNum",page);
        params.put("pageSize",10);
        return RetrofitManager.getInstance().getApi().userAccountRecord(params);
    }

    @Override
    public Observable<PageBean<UserActiveBean>> userActiveRecordPage(int page) {
        Map<String,Object> params = new HashMap<>();
        params.put("pageNum",page);
        params.put("pageSize",10);
        return RetrofitManager.getInstance().getApi().userActiveRecordPage(params);
    }

    @Override
    public Observable<PageBean<UserExperienceBean>> rewardExperienceUser(int page) {
        Map<String,Object> params = new HashMap<>();
        params.put("pageNum",page);
        params.put("pageSize",10);
        return RetrofitManager.getInstance().getApi().rewardExperienceUser(params);
    }

    @Override
    public Observable<List<MasterLevelBean>> masterList() {
        return RetrofitManager.getInstance().getApi().masterList();
    }
}
